Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a centralized please command #1537

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jaresty
Copy link
Contributor

@jaresty jaresty commented Aug 11, 2024

To avoid divergence in the grammar for please commands, it is useful to define a centralized tag and allow it to be overridden in command implementations.

Addresses #1536

@jaresty
Copy link
Contributor Author

jaresty commented Aug 11, 2024

I was able to test this in VSCode and jet brains on the mac but I was unable to test the other implementations to make sure they're working. I could use a hand with testing on other platforms to make sure these things still work, though the implementations appear correct to me right now.

Copy link
Collaborator

@nriley nriley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to use a tag for this to avoid "promising what we can't deliver". With the exception of the tiny nit I mentioned, the only other thing I can think that might is whether we'd like to continue sending an empty string for "please" by itself or define two voice commands and an action with an optional argument. I don't feel strongly one way or the other.

apps/jetbrains/jetbrains.py Outdated Show resolved Hide resolved
@jaresty jaresty requested a review from nriley August 18, 2024 02:35
apps/jetbrains/jetbrains.talon Show resolved Hide resolved
apps/arc/arc.py Outdated
@@ -20,6 +20,11 @@ def tab_close_wrapper():
actions.sleep("180ms")
actions.app.tab_close()

def please_command(command: str):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to call this command_search instead. Also the argument should probably be optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do this but I'm not sure if I did it right. Please check my work-thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is a discussion if we want to default to an empty string or None.

def draft_show(text: Optional[str] = None):

Also I personally feel that if the argument is optional we should do an if statement an only do sleep and insert if we actually have an argument.
https://github.com/AndreasArvidsson/andreas-talon/blob/114911424dc568d833b865f64f8607ac83275a6d/apps/vscode/vscode_git.py#L63-L67

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When calling the action from talon script, you still need to pass the argument (I.e. arg or ""), right? Otherwise you'll get an error, I think. Unless there's some way I don't know about.

Copy link
Collaborator

@AndreasArvidsson AndreasArvidsson Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not of its optional. You just need to do it that way I linked above, but you need to call it from a separate command. (arg) doesn't work if arg is optional. You call it without any argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through and added the conditions. Do you think I should add the separate command? I wasn't sure about that.

 To avoid divergence in the grammar for please commands, it is useful to define a centralized tag and allow it to be overridden in command implementations.
- It looks like the formatting was more than just adding a comma ; this should be cleaner now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants